package com.home.fansea.controller;

import com.home.fansea.service.IMinioService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;


/**
 * @Projectname: minio-mode
 * @Filename: MinloController
 * @Author: fansea
 * @Data:2023/6/5 11:19
 * @Description: TODO
 */

@RestController
@RequestMapping("/minio")
public class MinioController {
    @Qualifier("minioServiceImpl")
    @Autowired
    private IMinioService minioService;

    @PostMapping("/upload")
    public String upload(MultipartFile file) {
       return   minioService.upload(file);
    }
    /*@RequestMapping(value ="/download",method ={RequestMethod.POST,RequestMethod.GET})
    public AjaxResult download(String fileName, HttpServletResponse res) {
        minioService.download(fileName,res);
        return  success();

    }
    @RequestMapping(value = "/delete", method = RequestMethod.DELETE)
    public AjaxResult delete(@PathVariable("fileName") String fileName) {
        return   success( minioService.delete(fileName));
    }*/
}
